local name = "i26_skillpoint"
local name2 = "i26_skillpoint2"
STRINGS.NAMES[string.upper(name)] = "战技点"
STRINGS.RECIPE_DESC[string.upper(name)]= "战技点"
STRINGS.NAMES[string.upper(name2)] = "战技点"
STRINGS.RECIPE_DESC[string.upper(name2)]= "战技点"

local function builder_onbuilt(inst, builder)
    if not builder or builder.components.i26skill == nil then return end 
    local skilltreeupdater = builder.components.skilltreeupdater
    if builder.components.i26skill:IsFull() then
        local item = SpawnPrefab("goldnugget") 
        if item then
            item.components.stackable:SetStackSize(10)
            if builder.components.inventory then
                builder.components.inventory:GiveItem(item)
            else
                LaunchAt(item, builder, nil, 1, 1)
            end
        end
    else
        builder.components.i26skill:DoDelta(1)
    end
    
end

local function fn()
    local inst = CreateEntity()
    
    inst.entity:AddTransform()

    inst:AddTag("CLASSIFIED")

    --[[Non-networked entity]]
    inst.persists = false

    --Auto-remove if not spawned by builder
    inst:DoTaskInTime(0, inst.Remove)

    if not TheWorld.ismastersim then
        return inst
    end

    inst.OnBuiltFn = builder_onbuilt

    return inst
end

local function fn2()
    local inst = CreateEntity()
    
    inst.entity:AddTransform()

    inst:AddTag("CLASSIFIED")

    --[[Non-networked entity]]
    inst.persists = false

    --Auto-remove if not spawned by builder
    inst:DoTaskInTime(0, inst.Remove)

    if not TheWorld.ismastersim then
        return inst
    end

    inst.OnBuiltFn = function(inst, builder)
        if not builder or builder.components.i26skill == nil then return end 
        local skilltreeupdater = builder.components.skilltreeupdater
        if builder.components.i26skill:IsFull() then
            local item = SpawnPrefab("goldnugget") 
            if item then
                item.components.stackable:SetStackSize(20)
                if builder.components.inventory then
                    builder.components.inventory:GiveItem(item)
                else
                    LaunchAt(item, builder, nil, 1, 1)
                end
            end
        else
            builder.components.i26skill:DoDelta(1)
        end
    end

    return inst
end
return Prefab(name, fn), Prefab(name2, fn2)